<?php
/**
 * Created by PhpStorm.
 * Author: ljz
 * Date: 2023/5/04
 * Time: 10:38
 */

namespace App\frontend\models;


use App\common\models\BaseModel;

/**
 * Class GifBoxLotteryModel
 * @package app\common\models
 */
class GifBoxLotteryModel extends BaseModel
{
    public $table = 'draw_activity';
    public $attributes = ['sort' => 0];

    /**
     * 定义字段名
     *
     * @return array
     */
    public function atributeNames()
    {
        return ['name' => '抽奖活动名称', 'draw_type' => '抽奖活动类型', 'thumb' => '图片'];
    }

    /**
     * 列表字段规则
     *
     * @return array
     */
    static public function list_rules()
    {
        return [
            'page'  => 'required | numeric',
            'limit' => 'required | numeric',
        ];
    }

    /**
     * 详情字段规则
     *
     * @return array
     */
    static public function info_rules()
    {
        return [
            'id'    => 'required | numeric',
        ];
    }

    /**
     * 字段验证返回错误信息
     *
     * @return array
     */
    static public function message()
    {
        return [
            'id.required'    => 'id不能为空',
            'id.numeric'     => 'id不是数字',
            'page.required'  => '当前页数不能为空',
            'page.numeric'   => '当前页数不是数字',
            'limit.required' => '分页页数不能为空',
            'limit.numeric'  => '分页页数不是数字',
        ];
    }

}
